import * as echarts from 'echarts/core';
import {CanvasRenderer}from 'echarts/renderers'
// 导入 LineChart 模块
import { LineChart,BarChart } from 'echarts/charts';
// 导入所需的组件
import {
  TitleComponent,
  TooltipComponent,
  GridComponent,
  DataZoomComponent,
  ToolboxComponent
} from 'echarts/components';

// 注册必要的模块
echarts.use([
  CanvasRenderer,
  LineChart,
  TitleComponent,
  TooltipComponent,
  GridComponent,
  DataZoomComponent,
  ToolboxComponent,
  BarChart
]);
export const init = (dom) => {
    return echarts.init(dom);
  };
  
export default echarts